#pragma once
#include <string>
#include<vector>
#include"Book.h"
using namespace std;

int flagStudent = 1;
int flagManager = 1;
class Person {
public:
    Person(string n, string s, int a) { name = n; sex = s; age = a; }
    Person(){}
    void setName(string n) { name = n; }
    string getName() { return name; }
    void setSex(string s) { sex = s; }
    string getSex() { return sex; }
    void setAge(int a) { age = a; }
    int getAge() { return age; }
protected:
    string name;
    string sex;
    int age;
};

class Student2 : public Person {
public:
    Student2(string n, string s, int a) :Person(name = n, sex = s, age = a){
        sno = flagStudent++; totalNum = 0;}
    Student2(){}
    void setSno(int no) { sno = no; }
    int getSno() { return sno; }
    void setTotalNum(int num) { totalNum = num; }
    int getTotalNum() { return totalNum; }
    void setBooklist(vector<Book> list) { booklist = list; }
    vector<Book> getBooklist() { return booklist; }
    int FindBooks() {
        for (int i = 0; i < (int)booklist.size(); i++) {
            if (booklist[i].getBname() == name)
                return i;
        }
        return -1;
    }
private:
    int totalNum;
    int sno;
    vector<Book> booklist;
};

class Manager2 : public Person {
public:
    Manager2(string n, string s, int a) :Person(name = n, sex = s, age = a) {
        mno = flagManager++;
    }
    Manager2(){}
    void setMno(int no) { mno = no; }
    int getMno() { return mno; }
private:
    int mno;
};
